package com.cskaoyan.shopping.converter;

import com.cskaoyan.shopping.dal.entitys.ItemCat;
import com.cskaoyan.shopping.dto.ItemCatDto;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import java.util.List;

@Mapper(componentModel = "spring")
public interface ItemCatConverter {

    @Mappings({
            @Mapping(source = "icon",target = "iconUrl")
    })
    ItemCatDto itemCat2ItemCatDto(ItemCat itemCat);

    @Mappings({})
    List<ItemCatDto> itemCats2ItemCatDtos(List<ItemCat> itemCats);
}
